public class MovieOperator {
    private Movie[] movies;

    public MovieOperator(Movie[] movies) {
        this.movies = movies;
    }

    public void printAllMovies() {
        System.out.println("--------系统全部电影信息如下----------");

        for(int i = 0; i < this.movies.length; ++i) {
            Movie m = this.movies[i];
            System.out.println("编号：" + m.getId());
            System.out.println("电影名称：" + m.getName());
            System.out.println("电影价格:" + m.getPrice());
            System.out.println("--------------------------");
        }

    }

    public void zhanshiMoviesById(int id) {
        for(int i = 0; i < this.movies.length; ++i) {
            Movie m = this.movies[i];
            if (m.getId() == id) {
                System.out.println("该电影信息如下");
                System.out.println("编号：" + m.getId());
                System.out.println("电影名称：" + m.getName());
                System.out.println("电影价格：" + m.getPrice());
                System.out.println("电影评分：" + m.getScore());
                System.out.println("电影导演：" + m.getDirector());
                System.out.println("电影主演：" + m.getActor());
                System.out.println("电影评分：" + m.getInfo());
                return;
            }
        }

        System.out.println("没有该电影信息");
    }
}
